package com.template.service.impl;


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.template.dto.GroupMessage;
import com.template.dto.User;
import com.template.mapper.MessageMapper;
import com.template.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Service;
import org.vosk.Model;
import org.vosk.Recognizer;

import javax.sound.sampled.AudioSystem;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;


@Service
public class MessageServiceImpl implements MessageService {


    @Autowired
    private MessageMapper messageMapper;
    @Override
    public User selectById(Integer userId) {
        return messageMapper.selectById(userId);
    }

    @Override
    public void insertMessage(GroupMessage groupMessage) {
        messageMapper.insertMessage(groupMessage);
    }

    @Override
    public List<GroupMessage> getAllGroupMessage() {

//        List<GroupMessage> groupMessagesList=messageMapper.getAllGoupMessage();

//        PageBean pageBean=new PageBean(1L,groupMessagesList);
        return messageMapper.getAllGoupMessage();
    }

}
